<?php

/**
 * JingYao-backend
 *
 * @link     https://gitee.com/wang-zhihui-release/jingyao-backend
 * @apiDocument https://gitee.com/wang-zhihui-release/jingyao-backend/wikis/
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateHouserScoreResultsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('houser_score_results', function (Blueprint $table) {
            $table->id();
            $table->integer('houser_id');
            $table->float('houser_score');
            $table->tinyInteger('admin_config')->default(2)->comment('村委有没有干预过 1 有 2 没有');
            $table->float('admin_set_score')->default(0)->comment('村委设置的分数');
            $table->float('real_score')->comment('如果村委设置了就取村委的, 没有就取实际计算的');
            $table->index('houser_score');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('houser_score_results');
    }
}
